﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Deployment.TeamFoundation.Entity;

namespace Deployment.TeamFoundation.Communication
{
    public abstract class CommunicationBase
    {
        #region [ Events ]
        public event EventHandler<TraceEventArgs> TraceEvent;
        #endregion [ Events ]        

        protected CommunicationBase() { }

        protected virtual void RaiseEventTrace(string message)
        {
            if (TraceEvent != null)
            {
                message = string.Format("{0}: {1}", DateTime.Now.ToString("ddmmyyyy"), message);
                RaiseEventTrace(new TraceEventArgs(message));
            }
        }

        protected virtual void RaiseEventTrace(TraceEventArgs trace)
        {
            if (TraceEvent != null)
            {
                TraceEvent(this, trace);
            }
        }
    }
}
